<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>黑马旅游-搜索</title>
    <link rel="stylesheet" type="text/css" href="css/common.css">
    <link rel="stylesheet" type="text/css" href="css/bootstrap.min.css">
    <link rel="stylesheet" href="css/search.css">
    <script src="js/jquery-3.3.1.js"></script>
    <script src="js/getParameter.js"></script>
    <script>
        var cid = getParameter("cid");
        var currentPage = getParameter("currentPage");
        var rname=getParameter("rname");
        if (rname){
            rname = window.decodeURIComponent(rname);
        }
        //alert(rname);
        var pageSize=5;
        function showlist(){
            if (currentPage=="NaN"||currentPage==undefined){
                currentPage=1;
            }
            currentPage=parseInt(currentPage);
            $.post("route/findByCid",{cid:cid,rname:rname,currentPage:currentPage,pageSize:pageSize},function (data){
                var str = '';
                for (var i = 0; i < data.list.length; i++) {
                    var route = data.list[i];
                    str+='<li onclick="javascript:loadother('+route.rid+')">\n' +
                        '                            <div class="img"><img src="'+route.rimage+'" alt="" width="300px"></div>\n' +
                        '                            <div class="text1">\n' +
                        '                                <p>'+route.rname+'</p>\n' +
                        '                                <br/>\n' +
                        '                                <p>'+route.routeIntroduce+'</p>\n' +
                        '                            </div>\n' +
                        '                            <div class="price">\n' +
                        '                                <p class="price_num">\n' +
                        '                                    <span>&yen;</span>\n' +
                        '                                    <span>'+route.price+'</span>\n' +
                        '                                    <span>起</span>\n' +
                        '                                </p>\n' +
                        '                                <p><a href="route_detail.html?rid='+route.rid+'">查看详情</a></p>\n' +
                        '                            </div>\n' +
                        '                        </li>';

                }
                $("#text").html(str);

                var begin;
                var end;
                if (data.totalPage<=10){
                    begin=1;
                    end=data.totalPage;
                }else if (data.currentPage>=5&&data.currentPage<=(data.totalPage-5)){
                    begin=data.currentPage-4;
                    end=data.currentPage+5;
                }else if (data.currentPage<5){
                    begin=1;
                    end=10;
                }else if (data.currentPage>(data.totalPage-5)){
                    end=data.totalPage;
                    begin=data.totalPage-9;
                }



                var lis = '<li onclick="javascript:loadother1('+cid+','+1+')"><a href="route_list.html?cid='+cid+'&currentPage='+1+'">首页</a></li>';
                lis += '<li class="threeword" onclick="javascript:loadother1('+cid+','+(currentPage-1)+')"><a href="route_list.html?cid='+cid+'&currentPage='+(currentPage-1)+'">上一页</a></li>';
                for (var i = begin; i <= end; i++) {
                    if (data.currentPage==i){
                        lis += '<li class="curPage" onclick="javascript:loadother1('+cid+','+i+')"><a href="route_list.html?cid='+cid+'&currentPage='+i+'">'+i+'</a></li>';
                    }else {
                        lis += '<li onclick="javascript:loadother1('+cid+','+i+')"><a href="route_list.html?cid='+cid+'&currentPage='+i+'">'+i+'</a></li>';
                    }

                }
                lis += '<li class="threeword" onclick="javascript:loadother1('+cid+','+(currentPage+1)+')"><a href="route_list.html?cid='+cid+'&currentPage='+(currentPage+1)+'">下一页</a></li>';
                lis += '<li class="threeword" onclick="javascript:loadother1('+cid+','+data.totalPage+')"><a href="route_list.html?cid='+cid+'&currentPage='+data.totalPage+'">末页</a></li>';
                $("#page").html(lis);

                $("#totopage").html(data.totalPage);
                $("#totocurr").html(data.totalCount);

            })
        }

        function showhot(){
            $.post("favorite/findlist",{currentPage:1},function (data){

                var str1 = '';
                var iii = 0;
                if (data.list.length>5){
                    iii=5;
                }else {
                    iii=data.list.length;
                }
                for (var i=0;i<iii;i++) {
                    var route = data.list[i];
                    str1 += '<li onclick="javascript:loadother('+route.rid+')">\n' +
                        '                            <div class="left"><img src="'+route.rimage+'" alt=""></div>\n' +
                        '                            <div class="right">\n' +
                        '                                <p>'+route.rname+'</p>\n' +
                        '                                <p>网付价<span>&yen;<span>'+route.price+'</span>起</span>\n' +
                        '                                </p>\n' +
                        '                            </div>\n' +
                        '                        </li>';
                }

                $("#hot").html(str1);

            })
        }

        function loadother(rid){
            location.href="route_detail.html?rid="+rid+"";
        }

        function loadother1(cid,currentPage){
            location.href="route_list.html?cid="+cid+"&currentPage="+currentPage+"";
        }

        $(function (){
            showlist();
            showhot();
        })
    </script>
</head>
<body>
<!--引入头部-->
<div id="header"></div>
    <div class="page_one">
        <div class="contant">
            <div class="crumbs">
                <img src="images/search.png" alt="">
                <p>黑马旅行><span>搜索结果</span></p>
            </div>
            <div class="xinxi clearfix">
                <div class="left">
                    <div class="header">
                        <span>商品信息</span>
                        <span class="jg">价格</span>
                    </div>
                    <ul id="text">
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>【减100元 含除夕/春节出发】广州增城三英温泉度假酒店/自由行套票</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>299</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>浪花朵朵旅行普吉岛丛林飞跃空中飞人探险游中文服务泰国旅游</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>899</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>黑妞皇家旅行普吉岛攀牙湾大船星光之旅皮划艇日落休闲特色体验</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>999</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>浪花朵朵旅行普吉岛皇帝岛珊瑚岛香蕉船拖拽伞水上项目</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>99</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>环游记 泰国清迈Lila massage女子监狱spa 丽菈泰式按摩马杀鸡</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>199</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>【减100元 含除夕/春节出发】广州增城三英温泉度假酒店/自由行套票</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>899</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>【减100元 含除夕/春节出发】广州增城三英温泉度假酒店/自由行套票</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>1199</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                        <li>
                            <div class="img"><img src="images/04-search_03.jpg" alt=""></div>
                            <div class="text1">
                                <p>泰国芭提雅三合一日游芭提雅蒂芬妮人妖秀成人门票bigeye含接送</p>
                                <br/>
                                <p>1-2月出发，网付立享￥1099/2人起！爆款位置有限，抢完即止！</p>
                            </div>
                            <div class="price">
                                <p class="price_num">
                                    <span>&yen;</span>
                                    <span>1589</span>
                                    <span>起</span>
                                </p>
                                <p><a href="route_detail.html">查看详情</a></p>
                            </div>
                        </li>
                    </ul>
                    <div class="page_num_inf">
                        <i></i> 共
                        <span id="totopage">12</span>页<span id="totocurr">132</span>条
                    </div>
                    <div class="pageNum">
                        <ul id="page">
                            <li><a href="">首页</a></li>
                            <li class="threeword"><a href="#">上一页</a></li>
                            <li><a href="#">1</a></li>
                            <li><a href="#">2</a></li>
                            <li><a href="#">3</a></li>
                            <li><a href="#">4</a></li>
                            <li><a href="#">5</a></li>
                            <li><a href="#">6</a></li>
                            <li><a href="#">7</a></li>
                            <li><a href="#">8</a></li>
                            <li><a href="#">9</a></li>
                            <li><a href="#">10</a></li>
                            <li class="threeword"><a href="javascript:;">下一页</a></li>
                            <li class="threeword"><a href="javascript:;">末页</a></li>
                        </ul>
                    </div>
                </div>
                <div class="right">
                    <div class="top">
                        <div class="hot">HOT</div>
                        <span>热门推荐</span>
                    </div>
                    <ul id="hot">
                        <li>
                            <div class="left"><img src="images/04-search_09.jpg" alt=""></div>
                            <div class="right">
                                <p>清远新银盏温泉度假村酒店/自由行套...</p>
                                <p>网付价<span>&yen;<span>899</span>起</span>
                                </p>
                            </div>
                        </li>
                        <li>
                            <div class="left"><img src="images/04-search_09.jpg" alt=""></div>
                            <div class="right">
                                <p>清远新银盏温泉度假村酒店/自由行套...</p>
                                <p>网付价<span>&yen;<span>899</span>起</span>
                                </p>
                            </div>
                        </li>
                        <li>
                            <div class="left"><img src="images/04-search_09.jpg" alt=""></div>
                            <div class="right">
                                <p>清远新银盏温泉度假村酒店/自由行套...</p>
                                <p>网付价<span>&yen;<span>899</span>起</span>
                                </p>
                            </div>
                        </li>
                        <li>
                            <div class="left"><img src="images/04-search_09.jpg" alt=""></div>
                            <div class="right">
                                <p>清远新银盏温泉度假村酒店/自由行套...</p>
                                <p>网付价<span>&yen;<span>899</span>起</span>
                                </p>
                            </div>
                        </li>
                        <li>
                            <div class="left"><img src="images/04-search_09.jpg" alt=""></div>
                            <div class="right">
                                <p>清远新银盏温泉度假村酒店/自由行套...</p>
                                <p>网付价<span>&yen;<span>899</span>起</span>
                                </p>
                            </div>
                        </li>
                    </ul>
                </div>
            </div>
        </div>
    </div>

    <!--引入头部-->
    <div id="footer"></div>
    <!--导入布局js，共享header和footer-->
    <script type="text/javascript" src="js/include.js"></script>
</body>

</html>